import os


class CommonConfig:
    DEBUG = True
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:@localhost:9999/flask01'
    # 设置sqlalchemy自动更新跟踪数据库
    SQLALCHEMY_TRACK_MODIFICATIONS = True


class DevelopmentConfig(CommonConfig):
    ENV = 'development'


class ProductionConfig(CommonConfig):
    ENV = 'production'
    DEBUG = False


# 全局路由
BASE_URL = os.path.abspath(os.path.join(os.path.dirname(__file__)))
# 上传文件(图片)目录
UPLOAD_URL = BASE_URL + os.path.join(r'\upload')
# 生成token秘钥
SECRET_KEY = '123456'
# 上传 用户头像目录
PROFILE_URL = BASE_URL + os.path.join(r'\profile')
# 上传视频格式限制
ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif','zip'}
# 上传文件大小限制(10M)
ALLOWED_SIZE = 1 * 1024 * 1024
